/*
  Jeffrey Minton
  controller.h
  Controller class: Responsible for sendding all control commands to the robot
  all commands should be sent using this class
*/

#ifndef CONTROLLER_H
#define CONTROLLER_H

#include "connection.h"
#include "QMessageBox"
#include "string.h"
#include <iostream>

using namespace std;

class Controller
{
public:
    Controller();

    //give this class a serial connection to use
    void comm(Connection *comm);

    //give a move command to the robot, f, b, s
    bool move(char direction);

    //get distance from one of the sonar sensors l, r
    int getDistance(char side, char fb);

    //spin the robot l, r
    bool spin(char direction);

    //set the turret angle
    QString turret(int angle);

    //get the various motor values
    int getVals(char side, char dir);

    //set the various motor values
    void setVals(char side, char dir, int val);

    //get the uv sensor reading
    int getUV();

private:
    Connection *arduino;//serial connection to use
    QMessageBox alert;

};

#endif // CONTROLLER_H
